import web
import model
import sys
import json

urls = ("/mysql", "mysql")
app = web.application(urls, globals())

class mysql:
    def GET(self):
        DataService = model.DataService()
        result = DataService.getList()
        data = {
            'from': 'python',
            'list': result
        }
        web.header('Content-type', 'application/json')
        return json.dumps(data)

if __name__ == "__main__":
    app.run()
